package com.william.jdbcplus.core.dialect.generator.impl;

import com.william.jdbcplus.core.dialect.generator.IAutoKey;

/**
 * Base Key Sequence 生成器
 *
 * @author niliwei
 */
public class BaseAutoKey implements IAutoKey {

    @Override
    public String getKeySql(String keySequence, int count) {
        return "select " + keySequence + ".nextval from (select 1 from all_objects where rownum<=" + count + ")";
    }


    @Override
    public String getKeySql(String keySequence) {
        return keySequence + ".NEXTVAL";
    }
}
